<?xml version="1.0" encoding="UTF-8"?>    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:util="http://java.sun.com/jsf/composite/components/util">
<f:view>
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<ui:composition template="/WEB-INF/templates/platTemplate.xhtml">
	 	<ui:define name="content">
	 		<div class="main_col">
	 			<h1>#{msgs['system.manage.goods.display']}</h1>
	 			<div class="main_content">
					<div class="clear clearfix"></div>
					<h:form id="manageCompanyForm">
						<a4j:commandLink action="#{manageCompanyPage.preCreateAction }" value="#{msgs['operate.add.display'] }" event="click" execute="@this" render="mainManageCompanyPanel"></a4j:commandLink>
						<a4j:outputPanel id="pageDataPanel" layout="block">
							<div class="scrollDivGrid">
								<div class="scrollDivGridInner">
							    	<ul id="companyUlHeader" class="headline">
							    		<li style="width:80px">#{msgs['operate.display'] }</li>
									    <li style="width:50px">#{msgs['company.serialNumber.display'] }</li>
										<li style="width:50px">#{msgs['company.status.display'] }</li>
						       			<li style="width:250px">#{msgs['company.name.display'] }</li>
						    			<li style="width:250px;">#{msgs['company.address.display'] }</li>
						    			<li style="width:60px">#{msgs['company.zip.display'] }</li>
									    <li style="width:150px;">#{msgs['company.contactPersonName.display'] }</li>
									    <li style="width:150px;">#{msgs['company.mobile.display'] }</li>
									    <li style="width:150px;">#{msgs['company.phone.display'] }</li>
									    <li style="width:150px;">#{msgs['company.fax.display'] }</li>
									    <li style="width:150px;">#{msgs['company.email.display'] }</li>
									    <li style="width:150px;">#{msgs['company.url.display'] }</li>
									    <li style="width:200px">#{msgs['company.description.display'] }</li>
									    <li style="width:200px">#{msgs['company.remarks.display'] }</li>
									    <li style="width:400px"  class="br">#{msgs['company.relative.province.display'] }</li>
									</ul>
									<a4j:repeat value="#{manageCompanyPage.page.page.result}" var="company" rowKeyVar="rowNo">
										<ul id="companyUl#{rowNo}" class="#{((company.id eq manageCompanyPage.view.id) or (company.id eq manageCompanyPage.edit.id) )?'selected':''}">
											<li style="width:80px">
												<a4j:commandLink action="#{manageCompanyPage.viewAction }" value="#{msgs['operate.view.display'] }" event="click" execute="@this" render="mainManageCompanyPanel" oncomplete="javascript:setUlColor('companyUl#{rowNo}')"><f:param name="companyId" value="#{company.id }"></f:param></a4j:commandLink>
												<f:verbatim>&nbsp;&nbsp;</f:verbatim>
												<a4j:commandLink action="#{manageCompanyPage.editAction }" value="#{msgs['operate.edit.display'] }" event="click" execute="@this" render="mainManageCompanyPanel" oncomplete="javascript:setUlColor('companyUl#{rowNo}')"><f:param name="companyId" value="#{company.id }"></f:param></a4j:commandLink>
											</li>
											<li style="width:50px"><h:outputLabel value="#{company.serialNumber}"></h:outputLabel></li>
										    <li style="width:50px"><util:commonStatusLabel status="#{company.status }" style=""></util:commonStatusLabel></li>
										    <li style="width:250px;" title="#{company.name }"><h:outputLabel value="#{company.name }"></h:outputLabel></li>
										    <li style="width:250px" title="#{company.address }"><h:outputLabel value="#{company.address }"></h:outputLabel></li>
										    <li style="width:60px;"><h:outputLabel value="#{company.zip }"></h:outputLabel></li>
										    <li style="width:150px;"><h:outputLabel value="#{company.contactPersonName}"></h:outputLabel></li>
										    <li style="width:150px;"><h:outputLabel value="#{company.mobile}"></h:outputLabel></li>
										    <li style="width:150px;"><h:outputLabel value="#{company.phone }"></h:outputLabel></li>
										    <li style="width:150px"><h:outputLabel value="#{company.fax}"></h:outputLabel></li>
										    <li style="width:150px"><h:outputLabel value="#{company.email }"></h:outputLabel></li>
										    <li style="width:150px"><h:outputLabel value="#{company.url }"></h:outputLabel></li>
										    <li style="width:200px" title="#{company.description }"><h:outputLabel value="#{company.description }"></h:outputLabel></li>
										    <li style="width:200px"><h:outputLabel value="#{company.remarks }"></h:outputLabel></li>
										    <li style="width:400px" class="br">
										    	<h:selectManyCheckbox id="relativeProvinces" value="#{company.linkedProvinces}" layout="lineDerection" disabled="true">
										    		<f:selectItems value="#{existProvince.provinceItems}"></f:selectItems>
										    		<f:ajax event="change" execute="@this" render="@this"></f:ajax>
										    	</h:selectManyCheckbox>
										    
										    <h:outputLabel value="#{company.relativeProvinces }"></h:outputLabel></li>

									  	</ul>
								  	</a4j:repeat>
								  	<script language="javascript">
										setUlLastBorder('companyUlHeader');
									</script>
								  	<a4j:outputPanel rendered="#{empty manageCompanyPage.page.page.result}" display="block">
								  		<span class="f13 fB">#{msgs['empty.data.display'] }</span>
								  	</a4j:outputPanel>
								</div>
							</div>
							<div id="d_p_list">
								<util:pageNavigation pageData="#{manageCompanyPage.page.page }" pageNoAction="#{manageCompanyPage.selectPageNo }" prePageNoId="prePageNoBtnFootHead" prePageNoLabel="#{msgs['page.navigation.pre.display']}" renderId="pageDataPanel" nextPageNoId="nextPageNoBtnFootHead" nextPageNoLabel="#{msgs['page.navigation.next.display']}"></util:pageNavigation>
							</div>
						</a4j:outputPanel>
						<a4j:outputPanel id="mainManageCompanyPanel" layout="block">
							<h:panelGrid columns="2" styleClass="normaltable" headerClass="al" columnClasses="percent15 al title,percent85" rendered="#{'VIEW' eq manageCompanyPage.action }">
								
								<f:facet name="header">
									<h:outputLabel value="#{msgs['branch.company.info.display'] }" styleClass="title f14 fN"></h:outputLabel>
									[<a4j:commandLink action="#{manageCompanyPage.viewToEditAction }" value="#{msgs['operate.edit.display'] }" event="click" execute="@this" render="mainManageCompanyPanel"></a4j:commandLink>]
								</f:facet>
								
								
								<h:outputLabel value="#{msgs['company.serialNumber.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.serialNumber }"></h:outputText>
								<h:outputLabel value="#{msgs['company.name.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.name }"></h:outputText>
								<h:outputLabel value="#{msgs['company.address.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.address }"></h:outputText>
								<h:outputLabel value="#{msgs['company.zip.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.zip }"></h:outputText>
								<h:outputLabel value="#{msgs['company.contactPersonName.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.contactPersonName }"></h:outputText>
								<h:outputLabel value="#{msgs['company.mobile.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.mobile }"></h:outputText>
								<h:outputLabel value="#{msgs['company.phone.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.phone }"></h:outputText>
								<h:outputLabel value="#{msgs['company.fax.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.fax }"></h:outputText>
								<h:outputLabel value="#{msgs['company.email.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.email }"></h:outputText>
								<h:outputLabel value="#{msgs['company.url.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.url }"></h:outputText>
								<h:outputLabel value="#{msgs['company.description.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.description }"></h:outputText>
								<h:outputLabel value="#{msgs['company.remarks.display'] }："></h:outputLabel>
								<h:outputText value="#{manageCompanyPage.view.remarks }"></h:outputText>
							</h:panelGrid>
							
							<h:panelGrid columns="2" styleClass="normaltable" headerClass="al" footerClass="ac" columnClasses="percent15 al title,percent85" rendered="#{('EDIT' eq manageCompanyPage.action) or ('NEW' eq manageCompanyPage.action) }">
								
								<f:facet name="header">
									<h:outputLabel value="#{msgs['branch.company.info.display'] }" styleClass="title f14 fN"></h:outputLabel>
								</f:facet>
								
								<h:outputLabel value="#{msgs['company.serialNumber.display'] }："></h:outputLabel>
								<h:panelGroup id="serialNumberGroup">
									<h:inputText id="serialNumber" value="#{manageCompanyPage.edit.serialNumber }" label="#{msgs['company.serialNumber.display'] }" maxlength="11" styleClass="normal_input_text w50"><f:validateLongRange minimum="1" maximum="99999999999"></f:validateLongRange><f:ajax event="blur" execute="@this" render="serialNumberGroup"></f:ajax></h:inputText>
									<h:message for="serialNumber" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.status.display'] }："></h:outputLabel>
								<h:selectOneMenu value="#{manageCompanyPage.edit.status }" styleClass="commonSelectBox" style="font-size:12px">
									<f:selectItems value="#{existCommonStatus.commonStatusItems}"></f:selectItems>
									<f:ajax event="change" execute="@this" render="@this"></f:ajax>
								</h:selectOneMenu>
								
								<h:outputLabel value="#{msgs['company.name.display'] }："></h:outputLabel>
								<h:panelGroup id="nameGroup">
									<h:inputText id="name" value="#{manageCompanyPage.edit.name }" label="#{msgs['company.name.display'] }" maxlength="100" styleClass="normal_input_text w200"><f:validator validatorId="EmptyValidator"></f:validator><f:ajax event="blur" execute="@this" render="nameGroup"></f:ajax></h:inputText>
									<h:message for="name" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.address.display'] }："></h:outputLabel>
								<h:panelGroup id="addressGroup">
									<h:inputText id="address" value="#{manageCompanyPage.edit.address }" label="#{msgs['company.address.display'] }" maxlength="300" styleClass="normal_input_text w300"><f:validator validatorId="AddressValidator"></f:validator><f:ajax event="blur" execute="@this" render="addressGroup"></f:ajax></h:inputText>
									<h:message for="address" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.zip.display'] }："></h:outputLabel>
								<h:panelGroup id="zipGroup">
									<h:inputText id="zip" value="#{manageCompanyPage.edit.zip }" label="#{msgs['company.zip.display'] }" maxlength="6" styleClass="normal_input_text w50"><f:validator validatorId="ZipValidator"></f:validator><f:ajax event="blur" execute="@this" render="zipGroup"></f:ajax></h:inputText>
									<h:message for="zip" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.contactPersonName.display'] }："></h:outputLabel>
								<h:panelGroup id="contactPersonNameGroup">
									<h:inputText id="contactPersonName" value="#{manageCompanyPage.edit.contactPersonName }" maxlength="100" styleClass="normal_input_text w200"><f:ajax event="blur" execute="@this" render="contactPersonNameGroup"></f:ajax></h:inputText>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.mobile.display'] }："></h:outputLabel>
								<h:panelGroup id="mobileGroup">	
									<h:inputText id="mobile" value="#{manageCompanyPage.edit.mobile }" label="#{msgs['company.mobile.display'] }" maxlength="100" styleClass="normal_input_text w200"><f:validator validatorId="MobileValidator"/><f:ajax event="blur" execute="@this" render="mobileGroup"></f:ajax></h:inputText>
									<h:message for="mobile" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.phone.display'] }："></h:outputLabel>
								<h:panelGroup id="phoneGroup">
									<h:inputText id="phone" value="#{manageCompanyPage.edit.phone }" label="#{msgs['company.phone.display'] }" maxlength="100" styleClass="normal_input_text w200"><f:validator validatorId="PhoneValidator"/><f:ajax event="blur" execute="@this" render="phoneGroup"></f:ajax></h:inputText>
									<h:message for="phone" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.fax.display'] }："></h:outputLabel>
								<h:panelGroup id="faxGroup">
									<h:inputText id="fax" value="#{manageCompanyPage.edit.fax }" label="#{msgs['company.fax.display'] }" maxlength="100" styleClass="normal_input_text w200"><f:validator validatorId="FaxValidator"/><f:ajax event="blur" execute="@this" render="faxGroup"></f:ajax></h:inputText>
									<h:message for="fax" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.email.display'] }："></h:outputLabel>
								<h:panelGroup id="emailGroup">
									<h:inputText id="email" value="#{manageCompanyPage.edit.email }" label="#{msgs['company.email.display'] }" maxlength="100" styleClass="normal_input_text w200"><f:validator validatorId="EmailValidator"/><f:ajax event="blur" execute="@this" render="emailGroup"></f:ajax></h:inputText>
									<h:message for="email" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.url.display'] }："></h:outputLabel>
								<h:panelGroup id="urlGroup">
									<h:inputText id="url" value="#{manageCompanyPage.edit.url }" label="#{msgs['company.url.display'] }" maxlength="100" styleClass="normal_input_text w200"><f:validator validatorId="UrlValidator"/><f:ajax event="blur" execute="@this" render="urlGroup"></f:ajax></h:inputText>
									<h:message for="url" styleClass="errormessage"></h:message>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.description.display'] }："></h:outputLabel>
								<h:panelGroup id="descriptionGroup">
									<h:inputText id="description" value="#{manageCompanyPage.edit.description }" maxlength="1000" styleClass="normal_input_text w300"><f:ajax event="blur" execute="@this" render="descriptionGroup"></f:ajax></h:inputText>
								</h:panelGroup>
								<h:outputLabel value="#{msgs['company.remarks.display'] }："></h:outputLabel>
								<h:panelGroup id="remarksGroup">
									<h:inputText value="#{manageCompanyPage.edit.remarks }" maxlength="1000" styleClass="normal_input_text w300"><f:ajax event="blur" execute="@this" render="remarksGroup"></f:ajax></h:inputText>
								</h:panelGroup>
								<f:facet name="footer">
									<a4j:commandButton type="submit" action="#{manageCompanyPage.updateAction}" value="#{msgs['button.update.display'] }" event="click" execute="@this" oncomplete="javascript:refreshPageAction();"  rendered="#{'EDIT' eq manageCompanyPage.action }" styleClass="btn"></a4j:commandButton>
									<a4j:commandButton type="submit" action="#{manageCompanyPage.saveAction}" value="#{msgs['button.save.display'] }" event="click" execute="@this" oncomplete="javascript:refreshPageAction();"  rendered="#{'NEW' eq manageCompanyPage.action }" styleClass="btn"></a4j:commandButton>
								</f:facet>
							</h:panelGrid>
							<a4j:jsFunction name="refreshA4jFunc" action="#{manageCompanyPage.refreshPageAction }" render="pageDataPanel"></a4j:jsFunction>
						</a4j:outputPanel>
					</h:form>
			
				</div>
			</div>
	 	</ui:define>
		 	
	</ui:composition>
</h:body>
</f:view>
</html>
